﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for OverRangException
/// </summary>
public class RetirementException : Exception
{
    public static int WITHDRAWAL_OVER_FUND_MIN_BALANCE = 100; // Minimum balance left in each fund is $500
    public static int WITHDRAWAL_OVER_ACCOUNT_MIN_BALANCE = 101;//Minimum balance left in account is $1000
    public static int WITHDRAWAL_LESS_THAN_MIN = 102; //The minimum amount that can be withdrawn is $500
    public static int PREMIUM_NOT_PAID_IN_FULL = 200; //The premium paid is less than full amount payable
    public static int CLAIM_AMOUNT_OVER_MAX = 300; //Claim amount should not exceed sum insured balance
    public static int NO_EXISTING_PLUS_RIDER = 301;//Only policies purchased with Critical Care Plus Rider will be engaged to Plus Rider Sum Insured
    public static int RECLAIM_EXCEPTION = 302; //Each type of claim can only be claimed once
   
    public static int FUND_SWITCH_MIN_PER_FUND = 400;//Minimum Switch Out amount per fund is $500 or entire fund value(100%) whichever lower.
    public static int MAX_FUND_NUMBER_PER_POLICY = 401;//Maximum no. of funds per policy is 5.
    public static int FUND_SWITCH_TARGET_TOTAL_PERCENTAGE = 402;//Total percentage allocation for Fund Switch Target must be 100%
    public static int REDIRECT_FUND_TOTAL_PERCENTAGE = 500;//Total percentage allocation for PREMIUM REDIRECTION must be 100%

    public static int CHECK_BOX_UNCHECKED = 600;

    public int code { set; get; }
    public String message { set; get; }

    public RetirementException(int code, String message)
	{
        this.code = code;
        this.message = message;
	}

    public RetirementException(int code)
    {

        switch (code)
        {
            case 100:
                this.message = "Minimum balance left in each fund is $500";
                break;
            case 101:
                this.message = "Minimum balance left in account is $1000";
                break;
            case 102:
                this.message = "The minimum amount that can be withdrawn is $500";
                break;
            case 200:
                this.message = "The premium paid is less than full amount payable";
                break;
            case 301:
                this.message = "There is no plus rider under current policy";
                break;
            case 400:
                this.message = "Minimum Switch Out amount per fund is $500 or entire fund value(100%) whichever lower.";
                break;
            case 401:
                this.message = "Maximum no. of funds per policy is 5.";
                break;
            case 402:
                this.message = "Total percentage allocation for Fund Switch Target Funds must be 100%";
                break;
            case 500:
                this.message = "Total fund allocation percentage for Premium Redirection must be 100%";
                break;
            case 600:
                this.message = "Please read the declarations before you submit request!";
                break;
            default:
                this.message = "Unknown Retirement Exception Occur";
                break;
        }
        
    }

    

}